<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			var array=[1,2,3,4,5,6,7,8];
			var result = array.map(pow);
			console.log(result);
			function pow(x)
			{
				return x*x;
			}
		</script>
	</body>
</html>